package com.wicket.okrframework.biz.service.nb;

import com.wicket.okrcomponent.common.annotations.BanAuto;
import com.wicket.okrframework.biz.service.dto.common.BizAppSceneRelDto;
import com.wicket.okrframework.biz.service.dto.common.BizSceneDto;
import com.wicket.okrframework.biz.service.dto.req.QuerySceneCollectionRemoveExistingDataListReqDto;
import com.wicket.okrframework.biz.service.dto.res.QuerySceneCollectionRemoveExistingDataListRespDto;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ： 手工接入方法
 * @since 2022/5/28 15:32
 *
 *
 * @version 1.0
 */
@Service
public class NbAppScene {
    /**
     * code:collectionRemoveExistingData
     * name:M查询可赋能业务应用场景列表（特殊方法）
     * desc:undefined
     **/
    @BanAuto
    @Trace(operationName = "M查询可赋能业务应用场景列表（特殊方法）")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    public QuerySceneCollectionRemoveExistingDataListRespDto querySceneCollectionRemoveExistingDataList(
            QuerySceneCollectionRemoveExistingDataListReqDto reqDto) {
        QuerySceneCollectionRemoveExistingDataListRespDto retData = new QuerySceneCollectionRemoveExistingDataListRespDto();
        List<BizSceneDto> filteredScene = new ArrayList<>(reqDto.getBizSceneList());
        for (BizSceneDto oneScene : reqDto.getBizSceneList()) {
            for (BizAppSceneRelDto oneAppSence : reqDto.getBizAppSceneRelList()) {
                if (oneScene.getBizSceneId().equals(oneAppSence.getBizSceneId())) {
                    filteredScene.remove(oneScene);
                }
            }
        }
        retData.setBizSceneList(filteredScene);
        return retData;
    }
    // 手工接入方法
}
